package cn.rongdao.jrkabao.model.remind;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import java.util.List;

import cn.rongdao.jrkabao.bean.remind.RemindBillBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/12/8
 */

public class RemindCreditCardBillsModel extends BaseKaMaoModel {

    public static RemindCreditCardBillsModel getInstance() {
        return getPresent(RemindCreditCardBillsModel.class);
    }

    public void creditCardBills(String remindId, Observer<List<RemindBillBean>> observer) {
        addParamStrings("id", FRString.valueOf(remindId));
        Observable<List<RemindBillBean>> observable = mServletApi.creditCardBills(mParams).map(new HttpFunction<List<RemindBillBean>>());
        toSubscribe(observable, observer);
    }

    public void creditCardBillsDetail(String remindId, String billMonth, Observer<List<RemindBillBean>> observer) {
        addParamStrings("id", FRString.valueOf(remindId));
        addParamStrings("bills_month", FRString.valueOf(billMonth));
        Observable<List<RemindBillBean>> observable = mServletApi.creditCardBillsDetail(mParams).map(new HttpFunction<List<RemindBillBean>>());
        toSubscribe(observable, observer);
    }
}